package com.code.day08;

public class Day08ArrayPerson {
    public static void main(String[] args) {
        Person[] arr = new Person[3];
        Person p1 = new Person("张三", 18);
        Person p2 = new Person("lisi", 19);
        Person p3 = new Person("wangwu", 20);
        arr[0] = p1;
        arr[1] = p2;
        arr[2] = p3;

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
            System.out.println(arr[i].getName()+arr[i].getAge());
        }
    }
}
